#ifndef _Identifier_h_
#define _Identifier_h_

#include <string>
#include <list>

namespace common
{
//assuming a unique ID can be assigned to a class...
struct Identifier
{
	std::string className;

	Identifier();
	Identifier(const Identifier & id) {*this=id;}
	Identifier(const std::string& _className) {className=_className;}
	Identifier(const char* _className) {className=_className;}

	const Identifier& operator =(const Identifier& id){className = id.className;return *this;}
	bool operator==(const Identifier& id) const {return className==id.className;}
	bool operator!=(const Identifier& id) const {return !(*this==id);}
	bool operator<(const Identifier& id) const {return (className<id.className);}
};

typedef std::list<Identifier> Identifiers;

//
//a class that can be assigned a unique id is 
class Identifiable
{
protected:
	Identifier id;
public:
	virtual ~Identifiable() {}

	virtual Identifier& getId() {return id;}
	virtual const Identifier& getId() const {return id;}
	virtual void setId(const Identifier& _id) {id=_id;}
};
} //namespace

#endif